#@head() 
#@header()
<title>工单管理</title>
#@aside("ticket")
<div class="content-wrapper">
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
					<div class="box-header">
						<h3 class="box-title" style="margin-left: 10px;">工单列表</h3>
						<button id="newclient" style="float: right; margin: 0 15px 5px 0; width: 80px;" type="button" onclick="location.href='#(path)/ticket/add'" class="btn btn-block btn-info">添加工单</button>
						<div class="box-body">
							<table id="example1" class="table table-striped">
								<thead>
									<tr>
										<th>ID</th>
										<th>客户姓名</th>
										<th>客户号码</th>
										<th>问题描述</th>
										<th>工单状态</th>
										<th>日期</th>
									</tr>
								</thead>
								<tbody>
									#for(Lis:list.list)
									<tr>
										<td>#(Lis.id)</td>
										<td>#(Lis.getClient().realname)</td>
										<td>#(Lis.phone)</td>
										<td>#(Lis.description)</td>
										<td>
											#if(Lis.step==1)
											<label class="label label-warning">跟踪中</label>
											#elseif(Lis.step==2)
											<label class="label label-success">审批中</label>
											#elseif(Lis.step==3)
											<label class="label label-success">归档</label>
											#else
											<label class="label label-primary">未知</label>
											#end
										</td>  
										<td>#(date.stampToDate(Lis.createtime??"1"))</td> 
										<td><a href="#(path)/ticket/add?id=#(Lis.id)" class="btn btn-success">编辑</a> 
											<a data-id="#(Lis.id)" class="btn btn-danger">删除</a></td>
									</tr>
									#end
								</tbody>
							</table>
						</div>
					</div>
					#@paginate(list.pageNumber, list.totalPage, path+"/ticket/list?page=")
				</div>
			</div>
		</div>
	</section>
</div>

 


#@footer()
<script>
	$(document).ready(function() {
		$(".btn-danger").click(function() {
			var id = $(this).data("id");
			layer.confirm('确认删除？', {
				btn : [ '删除', '取消' ]
			}, function() {
				layer.msg('已删除！', {
					icon : 1
				});
				location.href = "#(path)/ticket/del?id="+id;
			}, function() {
				layer.msg('已取消', {
					icon : 1
				});
			});
		});
	});
</script>
</body>
</html>

